package com.cyl.config.ecxle;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;
import com.cyl.manager.oms.convert.SukToString;

public class ExcelSysDictStringGgConvert implements Converter<String>{
	    
	@Override
    public WriteCellData<?> convertToExcelData(String value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) {
		if(value==null) {
            return new WriteCellData<>("");
        }
		try {
			value = SukToString.sukJsonToString(value);
            return new WriteCellData<>(value);
		} catch (Exception e) {
		}
        
        return new WriteCellData<>("");
		
    }
   
	@Override
    public Class<String> supportJavaTypeKey() {
        return String.class;
    }
 
    @Override
    public CellDataTypeEnum supportExcelTypeKey() {
        return CellDataTypeEnum.STRING;
    }
	public static void main(String[] args) {
		String value = "{\"包装\":\"250ml*24 礼盒装*1箱\"}";
		System.out.println();
	}
}